package com.hoshiicloud.lessee.feign.hystrix;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hoshiicloud.common.query.OmnipotentWrapper;
import com.hoshiicloud.common.rpc.Response;
import com.hoshiicloud.lessee.feign.LesseeUserFeignService;
import com.hoshiicloud.user.dto.userCenter.MemberDto;
import com.hoshiicloud.user.entity.company.AttachmentType;
import com.hoshiicloud.user.entity.company.Member;
import com.hoshiicloud.user.entity.store.PlatStore;
import com.hoshiicloud.user.entity.visitors.Visitors;
import com.hoshiicloud.user.param.PlatStoreConsumerPageParam;
import com.hoshiicloud.user.param.PlatStoreQueryParam;
import com.hoshiicloud.user.param.company.AttachmentTypePageParam;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

/**
 *  2019/8/12 17:30 qry
 */
@Slf4j
public class LesseeUserFeignServiceFallback implements FallbackFactory<LesseeUserFeignService> {

    @Override
    public LesseeUserFeignService create(Throwable throwable) {
        log.error("出现异常" + throwable.getMessage());
        return new LesseeUserFeignService() {

            @Override
            public Response<Page<AttachmentType>> getAttachmentTypePage(AttachmentTypePageParam param) {
                return Response.failed("获取证件类型分页列表失败"+ throwable.getMessage());
            }

            @Override
            public Response<AttachmentType> addAttachmentType(AttachmentType entity) {
                return Response.failed("新增证件信息失败"+ throwable.getMessage());
            }

            @Override
            public Response<Boolean> updateAttachmentType(AttachmentType entity) {
                return Response.failed("更新证件信息失败"+ throwable.getMessage());
            }

            @Override
            public Response<Boolean> deleteupdateAttachmentType(Long id) {
                return Response.failed("删除证件信息失败"+ throwable.getMessage());
            }

            @Override
            public Response<List<Visitors>> queryVisitorsBatch(List<OmnipotentWrapper> param) {
                return Response.failed("批量查询访客数信息失败"+ throwable.getMessage());
            }
        };
    }
}
